package edu.sctu.xialei.june.day20150623one;

import edu.sctu.xialei.june.day20150623one.http.util.UrlMethods;
import edu.sctu.xialei.june.day20150623one.http.util.UrlPath;
import edu.sctu.xialei.june.day20150623one.json.util.DataStore;
import edu.sctu.xialei.june.day20150623one.json.util.JsonParse;

import java.io.IOException;

/**
 * Created by Administrator on 2015/6/23.
 */
public class Call {
    public static void main(String[] args) {

        String json = null;
        try {
            json = new UrlMethods().urlGET(new UrlPath().setPath("api.ii.com.cn//goods/apprec"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        DataStore dataStore = new JsonParse().parse(json);

        System.out.println("\n***** 产品信息 *****\n");
        for (int i = 0; i < dataStore.list.size(); i++) {
            System.out.println("\n------ 产品 " + (i + 1) + " ------");
            System.out.println("名称: " + dataStore.list.get(i).goods_name);
            System.out.println("介绍: " + dataStore.list.get(i).goods_introduce);
            System.out.println("价格: " + dataStore.list.get(i).goods_price);
            System.out.println("电话: " + dataStore.list.get(i).goods_device);
        }
    }

}